package com.zhangwei.day43bluetooth.task;

import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;

import java.io.IOException;
import java.util.UUID;

/**
 * @author zhangwei
 * @version V1.0
 * @Title: Advanced
 * @Package com.zhangwei.day43bluetooth.task
 * @Description:
 * @date 15/10/27 上午10:54
 */

public class ClientThread extends Thread {
    private BluetoothDevice device;

    private UUID uuid = UUID.fromString("00002a37-0000-1000-8000-00805f9b34fb");

    public ClientThread(BluetoothDevice device) {
        this.device = device;
    }

    @Override
    public void run() {
        super.run();
        try {
            BluetoothSocket socket = device.createRfcommSocketToServiceRecord(uuid);
            socket.connect();
        } catch (IOException e) {
            e.printStackTrace();
        }


    }
}
